package org.zhadoop.streaming.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 系统工具类，提供基本的工具函数
 * @author zwd
 *
 */
public class StreamingUtils {
	private static final Logger LOG = LoggerFactory.getLogger(StreamingUtils.class);
	
	public static void close(AutoCloseable... statements){
		for(AutoCloseable sts : statements){
			if(sts == null){
				continue;
			}
			try {
				sts.close();
			} catch (Exception e) {
				 //忽略关闭异常，不打印堆栈
                LOG.warn("Failed to close statement.");
			}
		}
	}
	
}
